-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read and basic correlation for execution trace #57
Conversation
b1479c2
to
5538797
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
==========================================
+ Coverage 90.26% 90.45% +0.19%
==========================================
Files 27 29 +2
Lines 2044 2148 +104
==========================================
+ Hits 1845 1943 +98
- Misses 199 205 +6
☔ View full report in Codecov by Sentry. |
hta/common/execution_trace.py
Outdated
et = ExecutionGraph(json.load(f)) | ||
t_end = time.perf_counter() | ||
|
||
t_end = time.perf_counter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need t_end
twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh my bad, copy pasted extra one
hta/common/execution_trace.py
Outdated
|
||
def _et_has_overlap(trace_df: pd.DataFrame, et: ExecutionGraph) -> bool: | ||
"""Use record function IDs (rf_id) to find out if ET and Kineto trace | ||
have overlap""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the same documentation style as in the function above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this is an internal function hence didn't let me fix this
if "et_node" not in trace_df: | ||
logger.error("Please run correlate_execution_trace() first") | ||
return | ||
if column == "op_schema": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be returned if any of the if/elif blocks from line 135-164 are reached? only the function definition is called. are the functions executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the function is used as a lambda / mapping function below. Initially I had lambdas but there was a lint suggesting not assigning lambda to variable.
hta/common/trace.py
Outdated
@@ -91,6 +91,14 @@ def get_sym_id_map(self) -> Dict[str, int]: | |||
def get_sym_table(self) -> List[str]: | |||
return self.sym_table | |||
|
|||
def add_back_symbols(self, trace_df: pd.dataframe, col: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a "back" symbol? do you mean append symbol to dataframe, as it may have been removed earlier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea adding back the string symbols, should i call it expand_symbols()
or something?
requirements.txt
Outdated
@@ -3,3 +3,4 @@ jupyterlab>=3.5.1 | |||
numpy>=1.23.5 | |||
pandas>=1.5.2 | |||
plotly>=5.11.0 | |||
pydot>=1.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? where is it being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check if this is required or not, it is being imported in execution trace file so I added it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it being added to execution_trace.py or are you referring to some other file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execution_trace.py uses param -> which uses pydot import. I tried and we cannot run the notebook without it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the notebook,
- "Collecting PyTorch trace is covered in the official PyTorch recipe here. " does not contain the hyperlink.
- Code Cell 3 can be cleaned up. there are two trace_dir statements.
@briancoutinho Do you want to add documentation for this new feature? |
hta/common/execution_trace.py
Outdated
import sys | ||
import time | ||
|
||
from typing import List # Dict, , NamedTuple, Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing execution trace support to HTA @briancoutinho
@anupambhatnagar i'll add it in a follow up :) |
@briancoutinho has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@briancoutinho has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@briancoutinho merged this pull request in c24333b. |
What does this PR do?
Add ability to read and correlate execution trace explained in #58
Before submitting